package com.eastfair.venuebooking.api;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.core.base.R;
import com.eastfair.core.base.entity.SuperEntity;
import com.eastfair.home.dto.ReportServiceAuditDTO;
import com.eastfair.venueservice.dto.ServiceBookingDTO;
import com.eastfair.venueservice.dto.ServiceBookingQuery;
import com.eastfair.venueservice.dto.ServiceBookingUpdateDTO;
import com.eastfair.venueservice.vo.ServiceBookingVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotEmpty;
import java.util.List;
import java.util.Map;

/**
 * 服务项Feign
 * @author linan
 */
@FeignClient(value = "venue-services-manage/serviceBooking")
public interface ServiceBookingFeign {

    /**
     * 服务预订列表
     *
     * @param serviceBookingQuery 服务预订列表
     * @return R
     */
    @PostMapping("/queryServiceBookingList")
    R<List<ServiceBookingVO>> queryServiceBookingList(@RequestBody ServiceBookingQuery serviceBookingQuery);

    /**
     * 回填预订服务的审核结果
     * @param serviceBookingDTO serviceBookingDTO
     * @return R<Boolean>
     */
    @PostMapping(value = "/updateServiceBookingAuditResult")
    R<Boolean> updateServiceBookingAuditResult(@RequestBody List<ServiceBookingDTO> serviceBookingDTO);

    /**
     * 添加服务预订
     * @param serviceBookingDTO serviceBookingDTO
     * @return R<Boolean>
     */
    @ApiOperation(value = "添加服务预订")
    @PostMapping(value = "/addServiceBooking")
    R<Boolean> addServiceBooking(@RequestBody List<ServiceBookingDTO> serviceBookingDTO);

    /**
     * 添加服务预订（报馆后预订的服务）
     * @param serviceBookingDTO serviceBookingDTO
     * @return R<Boolean>
     */
    @ApiOperation(value = "添加服务预订（报馆后预订的服务）")
    @PostMapping(value = "/addServiceBookingAfterReport")
    R<Boolean> addServiceBookingAfterReport(@RequestBody List<ServiceBookingDTO> serviceBookingDTO);


    /**
     * 删除预定服务
     * @param serviceBookingDTO serviceBookingDTO
     * @return R<Boolean>
     */
    @ApiOperation(value = "删除预定服务")
    @PostMapping(value = "/delServiceBooking")
    R<Boolean> delServiceBooking(@RequestBody ServiceBookingDTO serviceBookingDTO);


    /**
     * 提交服务预订
     * @param serviceBookingDTO serviceBookingDTO
     * @return R<Boolean>
     */
    @ApiOperation(value = "保存服务预订")
    @PostMapping(value = "/saveServiceBooking")
    R<Boolean> saveServiceBooking(@RequestBody List<ServiceBookingDTO> serviceBookingDTO);

    /**
     * 报馆提交服务预订
     * @param reportSpaceId 报馆ID
     * @param reportSpaceAuditId 报馆审核ID
     * @return R<Boolean>
     */
    @ApiOperation(value = "报馆提交服务预订")
    @GetMapping(value = "/submitServiceBookingWhenReport")
    R<List<ReportServiceAuditDTO>> submitServiceBookingWhenReport(@RequestParam("reportSpaceId") Long reportSpaceId, @RequestParam("reportSpaceAuditId") Long reportSpaceAuditId);

    /**
     * 报馆取消服务预订
     * @param reportSpaceId 报馆ID
     * @return R<Boolean>
     */
    @ApiOperation(value = "报馆取消服务预订")
    @GetMapping(value = "/cancelBookingOfReportSpace")
    R<Boolean> cancelBookingOfReportSpace(@RequestParam("reportSpaceId") Long reportSpaceId);

    /**
     * 取消预订
     * @param serviceBookingUpdateDTO 预订服务
     * @return R<Boolean>
     */
    @ApiOperation(value = "取消预订")
    @PostMapping("/cancelServiceBooking")
    R<Boolean> cancelServiceBooking(@RequestBody ServiceBookingUpdateDTO serviceBookingUpdateDTO);

    /**
     * 服务预订管理列表
     *
     * @param serviceBookingQuery 服务预订管理列表
     * @return R
     */
    @ApiOperation(value = "服务预订管理列表", notes = "服务预订管理列表")
    @PostMapping("/queryServiceBookingManage")
    R<Page<ServiceBookingVO>> queryServiceBookingManage(@RequestBody PageParams<ServiceBookingQuery> serviceBookingQuery);

    /**
     * 主场一键报馆的全部服务
     *
     * @param serviceBookingQuery 主场一键报馆的全部服务
     * @return R
     */
    @ApiOperation(value = "主场一键报馆的全部服务", notes = "主场一键报馆的全部服务")
    @PostMapping("/queryServiceBookingOfHome")
    R<Page<ServiceBookingVO>> queryServiceBookingOfHome(@RequestBody PageParams<ServiceBookingQuery> serviceBookingQuery);

    /**
     * 主场一键报馆服务
     * @param serviceBookingDTO 主场一键报馆服务
     * @return R<Boolean>
     */
    @ApiOperation(value = "主场一键报馆服务")
    @PostMapping(value = "/submitServiceBookingToVenue")
    R<Boolean> submitServiceBookingToVenue(@RequestBody List<ServiceBookingDTO> serviceBookingDTO);

    /**
     * 查询报馆服务数量
     * @param reportVenueSpaceNumbers
     * @return R<Boolean>
     */
    @ApiOperation(value = "查询报馆服务数量")
    @PostMapping(value = "/queryBookingServiceNum")
    R<Map<String,Integer>> queryBookingServiceNum(@RequestBody List<String> reportVenueSpaceNumbers);

    /**
     * 添加订单服务预订
     * @param serviceBookingDTO serviceBookingDTO
     * @return R<Boolean>
     */
    @ApiOperation(value = "添加订单服务预订")
    @PostMapping(value = "/addServiceBookingOfOrder")
    R<Boolean> addServiceBookingOfOrder(@RequestBody @Validated @NotEmpty List<ServiceBookingDTO> serviceBookingDTO);

    /**
     * 订单服务预订列表
     *
     * @param serviceBookingQuery 订单服务预订列表
     * @return R
     */
    @ApiOperation(value = "订单服务预订列表", notes = "服务预订列表（主运）")
    @PostMapping("/queryServiceBookingListOfOrder")
    R<List<ServiceBookingVO>> queryServiceBookingListOfOrder(@RequestBody ServiceBookingQuery serviceBookingQuery);

    /**
     * 修改订单下服务提交状态
     * @param serviceBookingDTO
     * @return R<Boolean>
     */
    @ApiOperation(value = "修改订单下服务提交状态")
    @PostMapping(value = "/updateBookingServiceOrderStatus")
    R<Boolean> updateBookingServiceOrderStatus(@RequestBody ServiceBookingDTO serviceBookingDTO);

    /**
     * 统计展厅报馆服务数量
     * @param serviceBookingQuery 统计展厅报馆服务数量
     * @return R
     */
    @ApiOperation(value = "统计展厅报馆服务数量", notes = "统计展厅报馆服务数量")
    @PostMapping("/queryReportServiceCount")
    R<List<ServiceBookingVO>> queryReportServiceCount(@RequestBody ServiceBookingQuery serviceBookingQuery);

    /**
     * 主场一键报馆服务（客展导入）
     * @param serviceBookingDTO
     * @return R<Boolean>
     */
    @ApiOperation(value = "主场一键报馆服务（客展导入）")
    @PostMapping(value = "/submitServiceBookingToVenueOfImport")
    R<Boolean> submitServiceBookingToVenueOfImport(@RequestBody List<ServiceBookingDTO> serviceBookingDTO);
}
